{% extends 'dashboard/base.html' %}

{% block body %}

    {#<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>#}


    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-body">
                    <br>
                    {#                        <div class="float-right">#}
                    {#                            <form action="{% url 'dashboard:export' %}" method="post"#}
                    {#                                  class="forms-sample">#}
                    {#                                {% csrf_token %}#}
                    {#                                <div class="form-row align-items-center">#}
                    {#                                    <div class="col-auto my-1">#}
                    {#                                        <select name="type" class="custom-select mr-sm-2" id="inlineFormCustomSelect">#}
                    {#                                            <option value="csv" selected>CSV</option>#}
                    {#                                            <option value="json">JSON</option>#}
                    {#                                            <option value="yaml">YAML</option>#}
                    {#                                        </select>#}
                    {#                                    </div>#}
                    {#                                    <div class="col-auto my-1">#}
                    {#                                        <input type="hidden" name="project_id" value="{{project_id}}"/>#}
                    {#                                        <input type="hidden" name="severity" value="{{severity}}"/>#}
                    {#                                        <button type="submit" class="btn btn-primary"><i#}
                    {#                                                class="fas fa-arrow-alt-circle-down"></i></button>#}
                    {#                                    </div>#}
                    {#                                </div>#}
                    {#                            </form>#}
                    {#                        </div>#}
                    <div class="d-md-flex align-items-center">
                        <h1 class="card-title">{{ severity }} Vulnerability List</h1>
                    </div>
                    <br>
                    <br>
                    <div class="row">
                        <div class="table-responsive">
                            <table id="data_table" class="table table-striped table-bordered" width="100%">
                                <thead>
                                <tr>
                                    <th>Vulnerability</th>
                                    <th>Scanner</th>
                                    <th>Status</th>
                                    <th>URL/IP/Resource</th>
                                    <th>Risk</th>

                                </tr>
                                </thead>
                                <!--zap-->
                                <tbody>
                                <!-- add your scanner here  -->
                                {% for data in sast_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'staticscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&scan_name={{ data.title }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>
                                            {% with scanType=data.scanner %}
                                            <div class="p-1"><img src="{{ PARSER_DICT | get_icon:scanType }}" alt="user"
                                                    width="30" class="rounded-circle" data-toggle="tooltip"
                                                    data-placement="top"
                                                    title="{{ PARSER_DICT | get_displayName:scanType }}">
                                            </div>
                                            {% endwith %}
                                        </td>
                                        {% if data.vuln_status == 'Open' %}
                                            <td><span class="badge badge-pill badge-purple">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Closed' %}
                                        <td><span class="badge badge-pill badge-success">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                            <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}

                                        </td>
                                        {% endif %}

                                        {% if data.vuln_status == 'Duplicate' %}
                                            <td><span class="badge badge-pill badge-warning">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        <td>{{ data.fileName }}</td>

                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>

                                    </tr>
                                {% endfor %}

                                {% for data in cloud_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'cloudscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&scan_name={{ data.title }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>{% with scanType=data.scanner %}
                                            <div class="p-1"><img src="{{ PARSER_DICT | get_icon:scanType }}" alt="user"
                                                    width="30" class="rounded-circle" data-toggle="tooltip"
                                                    data-placement="top"
                                                    title="{{ PARSER_DICT | get_displayName:scanType }}">
                                            </div>
                                            {% endwith %}
                                        </td>
                                        {% if data.vuln_status == 'Open' %}
                                            <td><span class="badge badge-pill badge-purple">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Closed' %}
                                        <td><span class="badge badge-pill badge-success">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                            <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}

                                        </td>
                                        {% endif %}

                                        {% if data.vuln_status == 'Duplicate' %}
                                            <td><span class="badge badge-pill badge-warning">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        <td>{{ data.resourceName }}</td>

                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>

                                    </tr>
                                {% endfor %}


                                {% for data in web_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'webscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&scan_name={{ data.title }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>{% with scanType=data.scanner %}
                                            <div class="p-1"><img src="{{ PARSER_DICT | get_icon:scanType }}" alt="user"
                                                    width="30" class="rounded-circle" data-toggle="tooltip"
                                                    data-placement="top"
                                                    title="{{ PARSER_DICT | get_displayName:scanType }}">
                                            </div>
                                            {% endwith %}
                                        </td>
                                        {% if data.vuln_status == 'Open' %}
                                            <td><span class="badge badge-pill badge-purple">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Closed' %}
                                        <td><span class="badge badge-pill badge-success">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                            <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}

                                        </td>
                                        {% endif %}

                                        {% if data.vuln_status == 'Duplicate' %}
                                            <td><span class="badge badge-pill badge-warning">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        <td>{{ data.url }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}


                                {% for data in net_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'networkscanners:list_vuln_info' %}?scan_id={{ data.scan_id }}&ip={{ data.ip }}&scanner={{ data.scanner }}">{{ data.title }}</a>
                                        </td>
                                        <td>{% with scanType=data.scanner %}
                                            <div class="p-1"><img src="{{ PARSER_DICT | get_icon:scanType }}" alt="user"
                                                    width="30" class="rounded-circle" data-toggle="tooltip"
                                                    data-placement="top"
                                                    title="{{ PARSER_DICT | get_displayName:scanType }}">
                                            </div>
                                            {% endwith %}
                                        </td>
                                        {% if data.vuln_status == 'Open' %}
                                            <td><span class="badge badge-pill badge-purple">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Closed' %}
                                        <td><span class="badge badge-pill badge-success">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                            <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}

                                        </td>
                                        {% endif %}

                                        {% if data.vuln_status == 'Duplicate' %}
                                            <td><span class="badge badge-pill badge-warning">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        <td>{{ data.ip }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}

                                {% for data in pentest_all_high %}
                                    <tr data-target="#">

                                        <td>
                                            <a href="{% url 'pentest:vuln_details' %}?vuln_id={{ data.vuln_id }}">{{ data.vuln_name }}</a>
                                        </td>
                                        <td>Pentest</td>
                                        {% if data.vuln_status == 'Open' %}
                                            <td><span class="badge badge-pill badge-purple">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        {% if data.vuln_status == 'Closed' %}
                                        <td><span class="badge badge-pill badge-success">{{data.vuln_status}}</span>
                                        {% if data.note != None %}
                                            <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                        {% endif %}

                                        </td>
                                        {% endif %}

                                        {% if data.vuln_status == 'Duplicate' %}
                                            <td><span class="badge badge-pill badge-warning">{{ data.vuln_status }}</span>
                                                {% if data.note != None %}
                                                    <i data-toggle="tooltip" data-placement="top" title data-original-title="{{data.note}}" class="fas fa-comment-alt"></i>
                                                {% endif %}
                                            </td>
                                        {% endif %}
                                        <td>{{ data.vuln_url }}</td>
                                        <td><span
                                                class="badge badge-pill badge-{{ data.severity_color }}">{{ data.severity }}</span>
                                        </td>
                                    </tr>
                                {% endfor %}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}
